package controller;

import annotation.RequestMapping;
import dto.RepairDetail.RepairDetailResp;
import dto.RepairListReq;
import dto.Repair.RepairListResp;
import entity.ResultVO;
import service.RepairService;

import java.sql.SQLException;

/**
 * @author Kevin
 * @date 2020-12-29 20:04
 */
public class RepairController {

    private RepairService repairService;

    public RepairController() {
        this.repairService = new RepairService();
    }

    @RequestMapping("/repair/list")
    public ResultVO repairList(RepairListReq req) {
        RepairListResp result = repairService.repairList(req);
        return ResultVO.success(result);
    }

    @RequestMapping("/repair/{id}")
    public ResultVO repairDetail(Integer id) throws SQLException {
        RepairDetailResp result = repairService.repairDetail(id);
        return ResultVO.success(result);
    }

}
